package com.example.chat.agent.model;

import dev.langchain4j.model.zhipu.ZhipuAiChatModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ZhipuModel {
    @Value("${zhipu.api.key}")
    private String apiKey;

    public ZhipuAiChatModel getZhipuAiChatModel() {
        return ZhipuAiChatModel.builder()
                .apiKey(apiKey)
                .logRequests(true)
                .logResponses(true)
                .maxRetries(1)
                .build();
    }
}
